package com.by.config;

import com.by.bean.Minio;
import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MinioConfig {
    @Autowired
    private Minio minio;
    @Bean
    public MinioClient getMinioclient() {
        return MinioClient.builder().endpoint(minio.getUrl()) .
                credentials(minio.getUsername(),
                        minio.getPassword()).build();
    }
}

